home *** CD-ROM | disk | FTP | other *** search
/ X User Tools / X User Tools (O'Reilly and Associates)(1994).ISO / sun4c / archive / tcltk.z / tcltk / man / catn / lsort.n < prev    next >
Text File  |  1994-09-20  |  3KB  |  133 lines

  1.  
  2.  
  3.  
  4. lsort(n)              Tcl Built-In Commands                   7.0
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NAME
  11.      lsort - Sort the elements of a list
  12.  
  13. SYNOPSIS
  14.      lsort ?_s_w_i_t_c_h_e_s? _l_i_s_t
  15. _________________________________________________________________
  16.  
  17.  
  18. DESCRIPTION
  19.      This command sorts the elements of  _l_i_s_t,  returning  a  new
  20.      list in sorted order.  By default ASCII sorting is used with
  21.      the result returned in increasing order.   However,  any  of  |
  22.      the  following switches may be specified before _l_i_s_t to con-  |
  23.      trol  the  sorting   process   (unique   abbreviations   are  |
  24.      accepted):                                                    |
  25.  
  26.      -ascii                                                             ||
  27.                          Use  string comparison with ASCII colla-  |
  28.                          tion order.  This is the default.         |
  29.  
  30.      -integer                                                           ||
  31.                          Convert  list  elements  to integers and  |
  32.                          use integer comparison.                   |
  33.  
  34.      -real                                                              ||
  35.                          Convert  list elements to floating-point  |
  36.                          values and use floating comparison.       |
  37.  
  38.      -command _c_o_m_m_a_n_d                                                   ||
  39.                          Use _c_o_m_m_a_n_d as a comparison command.  To  |
  40.                          compare two  elements,  evaluate  a  Tcl  |
  41.                          script  consisting  of  _c_o_m_m_a_n_d with the  |
  42.                          two  elements  appended  as   additional  |
  43.                          arguments.   The script should return an  |
  44.                          integer less than, equal to, or  greater  |
  45.                          than  zero if the first element is to be  |
  46.                          considered  less  than,  equal  to,   or  |
  47.                          greater than the second, respectively.    |
  48.  
  49.      -increas-  |
  50.                          ing                                                        ||
  51.                          Sort  the  list  in   increasing   order  |
  52.                          (``smallest'' items first).  This is the  |
  53.                          default.                                  |
  54.  
  55.      -decreas-  |
  56.                          ing                                                        ||
  57.                          Sort  the  list  in   decreasing   order  |
  58.                          (``largest'' items first).
  59.  
  60.  
  61.  
  62.  
  63. Tcl                                                             1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. lsort(n)              Tcl Built-In Commands                   7.0
  71.  
  72.  
  73.  
  74. KEYWORDS
  75.      element, list, order, sort
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Tcl                                                             2
  130.  
  131.  
  132.  
  133.